<template>
  <div class="fllow-item">
    <div class="cate-cell" :class="{bd1px: showBorder}">
      <img v-if="showImg" :src="img" :style="{width: imgWidth}" alt>
      <span class="title">{{title}}</span>
    </div>
    <ul class="fllow-detail">
      <li>自购
        <span>¥ 1000</span>
      </li>
      <li>起跟
        <span>¥ 50</span>
      </li>
      <li>人数
        <span>50</span>
      </li>
      <li v-if="isDetail">奖金
        <span>¥ 3000</span>
      </li>
      <li v-else>
        <span class="fllow-btn" @click="$router.push({ path: `/follow/detail/${1}` })">跟单</span>
      </li>
    </ul>
    <div class="times">
      <span class="time">截止:11-07 11:25</span>
      <span class="time">开奖:11-08 12:25</span>
    </div>
    <div class="follow-type" v-if="isDetail && showWin">
      <img src="../assets/imgs/home/icon-winning@2x.png" alt="">
      <!-- <img src="../assets/imgs/home/icon-notwinning@2x.png" alt=""> -->
    </div>
  </div>
</template>

<script>
export default {
  props: {
    fllowItem: Object,
    id: String,
    img: {
      default: require('../assets/imgs/home/icon-hot1@2x.png')
    },
    imgWidth: String,
    showImg: {
      type: Boolean,
      default: true
    },
    title: {
      type: String,
      default: '百中百发，快来和我一起赚钱吧！'
    },
    desc: String,
    showBorder: {
      type: Boolean,
      default: true
    },
    buyMoney: [String, Number],
    fllowMoney: [String, Number],
    buyCount: [String, Number],
    isDetail: false,
    showWin: false
  }
};
</script>
<style lang="less" scoped>
.fllow-item {
  position: relative;
  background: #ffffff;
  .cate-cell {
    position: relative;
    width: 100%;
    height: 0.76rem;
    line-height: 0.8rem;
    background: #ffffff;
    &.bd1px:after {
      content: " ";
      display: block;
      position: absolute;
      width: 100%;
      bottom: 0;
      height: 1px;
      border-bottom: 1px solid #d2d2d2;
      color: #d2d2d2;
      transform-origin: 0 100%;
      transform: scaleY(0.5);
    }
    img {
      display: inline-block;
      width: 0.4rem;
      margin-left: 0.2rem;
      margin-right: 0.1rem;
    }
    .title {
      font-size: 0.26rem;
      color: #333333;
    }
  }
  .fllow-detail {
    position: relative;
    display: flex;
    // &::before {
    //   content: '';
    //   display: block;
    //   position: absolute;
    //   width: 100%;
    //   top: -1px;
    //   height: 1px;
    //   border-top: 1px solid #d2d2d2;
    //   color: #d2d2d2;
    //   transform-origin: 0 100%;
    //   transform: scaleY(0.5);
    // }
    &::after {
      content: "";
      display: block;
      position: absolute;
      width: 100%;
      bottom: 0;
      height: 1px;
      border-bottom: 1px solid #d2d2d2;
      color: #d2d2d2;
      transform-origin: 0 100%;
      transform: scaleY(0.5);
    }
    li {
      position: relative;
      flex: 1;
      height: 0.8rem;
      line-height: 0.8rem;
      font-size: 0.28rem;
      color: #666666;
      text-align: center;
      &::after {
        content: "";
        display: block;
        position: absolute;
        top: 0;
        right: 0;
        width: 1px;
        height: 0.8rem;
        background: #d2d2d2;
        transform: scaleX(0.5);
      }
      &:last-child::after {
        display: none;
      }
      span {
        color: #d44743;
      }
      .fllow-btn {
        display: inline-block;
        padding: 0 0.4rem;
        height: 0.6rem;
        line-height: 0.6rem;
        font-size: 0.3rem;
        color: #ffffff;
        background: #d44743;
        border-radius: 0.06rem;
      }
    }
  }
  .times {
    height: 0.6rem;
    line-height: 0.6rem;
    padding: 0 0.2rem;
    font-size: 0.22rem;
    color: #999999;
    overflow: hidden;
    span:last-child {
      float: right;
    }
  }
  .follow-type {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    width: 0.8rem;
    height: 0.8rem;
    img {
      display: block;
      width: 100%;
    }
  }
}
</style>
